 var userService = {
    login : function(param, resolve, reject){
        mm.request({
            url     : mm.getServerUrl('/user/app_do_login.json'),
            data    : param,
            method  : 'POST',
            success : resolve,
            error   : reject
        });
    },
    add : function(param, resolve, reject){
        mm.request({
            url     : mm.getServerUrl('/sys/user/add.json'),
            data    : param,
            method  : 'POST',
            success : resolve,
            error   : reject
        });
    },
    logout : function(resolve, reject){
        mm.request({
            url     : mm.getServerUrl('/user/logout.json'),
            method  : 'GET',
            success : resolve,
            error   : reject
        });
    },
    refreshToken : function(resolve, reject){
        mm.request({
            url     : mm.getServerUrl('/user/refresh_token.json'),
            method  : 'POST',
            success : resolve,
            error   : reject
        });
    },
    /**
     * 忘记密码状态下重置密码
     */
    forgetPassword : function(param, resolve, reject){
        mm.request({
            url     : mm.getServerUrl('/user/forget_reset_password.json'),
            data    : param,
            method  : 'POST',
            success : resolve,
            error   : reject
        });
    },
    /**
     * 重置密码
     */
    resetPassword : function(param, resolve, reject){
        mm.request({
            url     : mm.getServerUrl('/user/reset_password.json'),
            data    : param,
            method  : 'POST',
            success : resolve,
            error   : reject
        });
    },
    /**
     * 修改个人信息
     */
    updateInfo : function(param, resolve, reject){
        mm.request({
            url     : mm.getServerUrl('/user/update_infomation.json'),
            data    : param,
            method  : 'POST',
            success : resolve,
            error   : reject
        });
    },
    /**
     * 获取用户信息
     */
    getUserInfo : function(resolve, reject){
        mm.request({
            url     : mm.getServerUrl('/user/user_info.json'),
            method  : 'GET',
            success : resolve,
            error   : reject
        });
    }
 }